package com.recSys.offlineTask;

import static com.recSys.util.LogRecord.INFO;
import net.librec.common.LibrecException;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import com.recSys.dataProcessing.Deal4RecFun;
import com.recSys.dataTraining.Train4RecCeme;
import com.recSys.dataTraining.Train4RecFun;

/**
 * Created by dell on 2018/1/29.
 */
@Component
public class ScheduledModelTrain {

    /**
     * 定时更新两个线性分类模型
     * @throws LibrecException
     */
    @Scheduled(cron = "0 0/2 * * * *")
    public void schedule() {
        INFO.info("start to update models");
        Deal4RecFun.statistic();
        Train4RecFun.trainL2L2D();
        Train4RecFun.setModel();
        
//        Train4RecCeme.trainL2L2();
        INFO.info("models have been updated");
    }
}
